#ifndef KINECT_GUI_H
#define KINECT_GUI_H

#include <QMainWindow>
#include <QMessageBox>
#include <QFileDialog>
#include <XnOpenNI.h>
#include <XnLog.h>
#include <XnCppWrapper.h>
#include <QDebug>
#include <QTimer>
//#include <opencv2/core/core.hpp>
//#include <opencv2/highgui/highgui.hpp>
//#include <cv.h>
//#include <cvaux.h>



namespace Ui {
class KINECT_GUI;
}

class KINECT_GUI : public QMainWindow
{
    Q_OBJECT

public:
    explicit KINECT_GUI(QWidget *parent = 0);
    ~KINECT_GUI();

private slots:
    void on_bt_initialize_kinect_clicked();

    //    void on_bt_grabframe_kinect_clicked();

    void on_bt_record_clicked();

    void record_data();

    void on_bt_select_file_clicked();

private:
    Ui::KINECT_GUI *ui;
    //----------------------------------------------
    //OPENNI Kinect Stuff
    //----------------------------------------------
    // Context and Status
    xn::Context context;        bool context_init;
    XnStatus nRetVal; // Status cheker
    //Generators
    xn::DepthGenerator depth;   bool depth_init;
    xn::ImageGenerator color;   bool color_init;
    xn::UserGenerator user;     bool user_init;
    xn::Recorder recorder;      bool recorder_init;
    bool recorder_file,recorder_depth, recorder_color;
    bool startgeneration_init;
    bool aligment;
    xn::MockRawGenerator rawGenerator; bool rawGenerator_init;
    // Data types
    xn::DepthMetaData depthMD;  //Deth Meta data
    xn::ImageMetaData imageMD;  //Image Meta Data
    const XnRGB24Pixel* pImageMap;    //Pointer to color map
    const XnDepthPixel* pDepthMap;    //Pointer to Depth map
    // Number of Frames for Recording
    unsigned int n_frames;
    QString filename;

};

#endif // KINECT_GUI_H
